JCL samples

The samples below can be found the RA2002.SAMPLIB as of version 3.7.x

Sample 1
//SMFEXTR   EXEC  PGM=IFASMFDP                                          00070000
//STEPLIB   DD DISP=SHR,DSN=RA2002.V3R7M0.LINKLIB                       00080000
//SMFDATA1  DD    DISP=SHR,DSN=SYS1.MAN1                                00090000
//SMFOUT    DD    DSN=&&SMFFILE,                                        00100000
//          DISP=(,PASS),                                               00110000
//          DCB=(RECFM=VBS,LRECL=32760,BLKSIZE=6240),                   00120000
//          UNIT=SYSDA,SPACE=(CYL,(100,10))                             00130000
//SYSPRINT  DD SYSOUT=*                                                 00140000
//SYSIN     DD    *                                                     00150000
 INDD(SMFDATA1,OPTIONS(DUMP))                                           00160000
 ABEND(NORETRY)                                                         00170000
 OUTDD(SMFOUT,TYPE(80))                                                 00180000
 USER2(SMF$XT20)                                                        00190000
 USER3(SMF$XT21)                                                        00200000
/*                                                                      00210000
//FLTPRINT  DD   SYSOUT=*                                               00220000
//FLTINPUT  DD  *                                                       00230000
*                                                                       00240002
*  SAMPLE:  SELECT ALL SMF RECORDS TYPE 80 AND WITH                     00250002
*           USERID XRZP001 USING  POSITIONAL VALUES                     00260002
*                                                                       00270002
*  1        POS= 0006  = RECORD TYPE 80                 SMF80RTY        00280000
*  2        POS= 0023  = USERID                         SMF80USR        00290000
*                                                                       00300002
+INCLUDE    COND=((0006,1,HX,EQ,50),AND,                                00310000
                  (0023,8,CH,EQ,'XRZP001'))                             00320001
/*                                                                      00330000



Sample 2
//SMFEXTR   EXEC  PGM=IFASMFDP                                          00070001
//STEPLIB   DD DISP=SHR,DSN=RA2002.V3R7M0.LINKLIB                       00080001
//SMFDATA1  DD    DISP=SHR,DSN=SYS1.MAN1                                00090001
//SMFOUT    DD    DSN=&&SMFFILE,                                        00100001
//          DISP=(,PASS),                                               00110001
//          DCB=(RECFM=VBS,LRECL=32760,BLKSIZE=6240),                   00120001
//          UNIT=SYSDA,SPACE=(CYL,(100,10))                             00130001
//SYSPRINT  DD SYSOUT=*                                                 00140001
//SYSIN     DD    *                                                     00150001
 INDD(SMFDATA1,OPTIONS(DUMP))                                           00160001
 ABEND(NORETRY)                                                         00170001
 OUTDD(SMFOUT,TYPE(80))                                                 00180001
 USER2(SMF$XT20)                                                        00190001
 USER3(SMF$XT21)                                                        00200001
/*                                                                      00210001
//FLTPRINT  DD   SYSOUT=*                                               00220001
//FLTINPUT  DD  *                                                       00230001
*                                                                       00240001
*  SAMPLE:  SELECT ALL SMF RECORDS TYPE 80 AND WITH                     00250001
*           USERID XRZP001 USING "SYMBOLIC NAMES".                      00260001
*                                                                       00270001
*  1        POS= SMF80RTY = RECORD TYPE 80                              00280001
*  2        POS= SMF80USR = USERID                                      00290001
*                                                                       00300001
+INCLUDE    COND=((SMF80RTY,1,HX,EQ,50),AND,                            00310001
                  (SMF80USR,8,CH,EQ,'XRZP001'))                         00320001
/*                                                                      




Sample 3
//SMFEXTR   EXEC  PGM=IFASMFDP                                          00070001
//STEPLIB   DD DISP=SHR,DSN=RA2002.V3R7M0.LINKLIB                       00080001
//SMFDATA1  DD    DISP=SHR,DSN=SYS1.MAN1                                00090001
//SMFDATA2  DD    DISP=SHR,DSN=SYS1.MAN2                                00100001
//SMFDATA3  DD    DISP=SHR,DSN=SYS1.MAN3                                00110001
//*MFDATA1  DD    DSN=XRZP001.SMF.ALS$1003,DISP=OLD                     00120001
//SMFOUT    DD    DSN=&&SMFFILE,                                        00130001
//          DISP=(,PASS),                                               00140001
//          DCB=(RECFM=VBS,LRECL=32760,BLKSIZE=6240),                   00150001
//          UNIT=SYSDA,SPACE=(CYL,(100,10))                             00160001
//SYSPRINT  DD SYSOUT=*                                                 00170001
//SYSIN     DD    *                                                     00180001
 INDD(SMFDATA1,OPTIONS(DUMP))                                           00190001
 INDD(SMFDATA2,OPTIONS(DUMP))                                           00200001
 INDD(SMFDATA3,OPTIONS(DUMP))                                           00210001
 ABEND(NORETRY)                                                         00220001
 OUTDD(SMFOUT,TYPE(80))                                                 00230001
 USER2(SMF$XT20)                                                        00240001
 USER3(SMF$XT21)                                                        00250001
/*                                                                      00260001
//HEXPRINT  DD   SYSOUT=*                                               00270001
//FLTPRINT  DD   SYSOUT=*                                               00280001
//FLTINPUT  DD  *                                                       00290001
+OPTIONS    STOPAFT=500,SKIPREC=,DUMPREC=V,LRECL=,HITS=ONLY             00300001
*  1     (( POS= 0006  = RECORD TYPE 80                 SMF80RTY        00310001
*  2       (GET DATA TYPE SMF80DTP=X'04' ACCESS ALLOWED                 00320001
*  3        AND IT MUST BE OF VALUE X'80' ACCESS TYPE='ALTER') AND      00330001
*  4       (GET DATA TYPE SMF80DTP=X'01' RESOURCE NAME                  00340001
*  5        AND COMPARE IT BY USING A GENERIC COMPARE) ))               00350001
*                                                                       00360001
*  WHEN USING A GENERIC SEARCH("CG") THE LENGTH BYTE IS IRRELEVANT.     00370001
*  THE LENGTH WITHIN THE RELOCATEABLE SECTION WILL BE USED.             00370101
*                                                                       00370201
+INCLUDE    COND=((0006,1,HX,EQ,50),AND,                                00371001
                 ((0001(0004,H38,H40,I1,0),1,HX,EQ,04),AND,             00372001
                  (0001(0004,H38,H40,I1,2),1,HX,EQ,80)),AND,            00373001
                 ((0001(0004,H38,H40,I1,0),1,HX,EQ,01),AND,             00374001
                  (0001(0004,H38,H40,I1,2),0,CG,EQ,RA**)))              00375001
//                                                                      00376001
                                                                        00377001
   OR                                                                   00378001
                                                                        00379001
+INCLUDE    COND=((0006,1,HX,EQ,50),AND,                                00380001
                 ((0001(0004,H38,H40,I1,0),1,HX,EQ,04),AND,             00390001
                  (0001(0004,H38,H40,I1,2),1,HX,EQ,80)),AND,            00400001
                 ((0001(0004,H38,H40,I1,0),1,HX,EQ,01),AND,             00410001
                  (0001(0004,H38,H40,I1,2),2,CH,EQ,RA)))                00420001
//                                                                      00430001









Sample 4
//SMFEXTR   EXEC  PGM=IFASMFDP                                          00070001
//STEPLIB   DD DISP=SHR,DSN=RA2002.V3R7M0.LINKLIB                       00080001
//SMFDATA1  DD    DISP=SHR,DSN=SYS1.MAN1                                00090001
//SMFDATA2  DD    DISP=SHR,DSN=SYS1.MAN2                                00100001
//SMFDATA3  DD    DISP=SHR,DSN=SYS1.MAN3                                00110001
//*MFDATA1  DD    DSN=XRZP001.SMF.ALS$1003,DISP=OLD                     00120001
//SMFOUT    DD    DSN=&&SMFFILE,                                        00130001
//          DISP=(,PASS),                                               00140001
//          DCB=(RECFM=VBS,LRECL=32760,BLKSIZE=6240),                   00150001
//          UNIT=SYSDA,SPACE=(CYL,(100,10))                             00160001
//SYSPRINT  DD SYSOUT=*                                                 00170001
//SYSIN     DD    *                                                     00180001
 INDD(SMFDATA1,OPTIONS(DUMP))                                           00190001
 INDD(SMFDATA2,OPTIONS(DUMP))                                           00200001
 INDD(SMFDATA3,OPTIONS(DUMP))                                           00210001
 ABEND(NORETRY)                                                         00220001
 OUTDD(SMFOUT,TYPE(80))                                                 00230001
 USER2(SMF$XT20)                                                        00240001
 USER3(SMF$XT21)                                                        00250001
/*                                                                      00260001
//FLTPRINT  DD   SYSOUT=*                                               00270001
//FLTINPUT  DD  *                                                       00280001
+OPTIONS    STOPAFT=100,SKIPREC=,DUMPREC=V,LRECL=,HITS=ONLY             00290002
*                                                                       00300001
*                                                                       00310002
*                                                                       00320002
*  WHEN USING A GENERIC SEARCH("CG") THE LENGTH BYTE IS IRRELEVANT.     00330002
*  THE LENGTH WITHIN THE RELOCATEABLE SECTION WILL BE USED IF SET       00340002
*  SET TO "0".                                                          00350002
*                                                                       00360002
*  USING SYMBOLIC NAMES INSTEAD FOR THE SAMPLE BELOW:                   00370002
*                                                                       00380002
*           COND=((0006,1,HX,EQ,50),AND,                                00390002
*                ((0001(0004,H38,H40,I1,0),1,HX,EQ,04),AND,             00400002
*                 (0001(0004,H38,H40,I1,2),1,HX,EQ,80)),AND,            00410002
*                ((0001(0004,H38,H40,I1,0),1,HX,EQ,01),AND,             00420002
*                 (0001(0004,H38,H40,I1,2),0,CG,EQ,RA**)))              00430002
*                                                                       00440002
*                                                                       00450002
*                                                                       00460002
* NOTE: TESTING FOR A RELOCATABLE VALUE E.G. "040180"                   00470002
*       THIS MUST BE DONE IN PAIRS. THAT MEANS WE HAVE TO TEST          00480002
*       ON X'04'(SMF80DTP) AND X'80'(SMF80DTA):                         00490002
*     "(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTP),1,HX,EQ,04)" AND  00500002
*     "(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTA),0,HX,EQ,80)"      00510002
*                                                                       00520002
*      HENCE FOR THE SMF80DTP X'04' YOU MUST DEFINE THE LENGTH FOR IT.  00530002
*      FOR THE VALUE X'80' AT OFFSET SMF80DTA NO LENGTH MUST BE DEFINED 00540002
*      AS THE LENGTH WILL BE AUTOMATICALLY EXTRACTED WHEN SET TO '0'.   00550002
*      HOWEVER A LENGTH CAN BE DEFINED.                                 00560002
*                                                                       00570002
*                                                                       00580002
*      THIS SAMPLE BELOW EXTRACTS ALL RECORDS WHERE THE                 00590002
*      "ACCESS ALLOWED" IS "ALTER"  AND THE                             00600002
*      "RESOURCE NAME OR OLD RESOURCE NAME" STARTS WITH "RA**".         00610002
*                                                                       00620002
*      TESTING FOR A RELOCATABLE VALUE: "040180"  AND                   00630002
*                                       "01LLXXXX......"                00640002
*                                        . . .                          00650002
*                                        . . .= RESNAME AT SMF80DTA     00660002
*                                        . .                            00670002
*                                        . .                            00680002
*                                        . LL = INT.LENGTH AT SMF80DLN  00690002
*                                        .                              00700002
*                                        DATA TYPE SMF80DTP             00710002
*                                                                       00711002
+INCLUDE    COND=(,                                                     00720002
(SMF80RTY,1,HX,EQ,50),AND,                                              00730002
((1(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTP),1,HX,EQ,04),AND,      00740002
 (1(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTA),0,HX,EQ,80)),AND,     00750002
((1(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTP),1,HX,EQ,01),AND,      00760002
 (1(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTA),0,CG,EQ,RA**)))       00770002
*                                                                       00771002
//                                                                      00780002




Sample 5
//SMFEXTR   EXEC  PGM=IFASMFDP                                          00070000
//STEPLIB   DD DISP=SHR,DSN=RA2002.V3R7M0.LINKLIB                       00080000
//OUTDD     DD DISP=SHR,DSN=XRZP001.IRRADU00.OUTDDNEW,                  00090000
//          DCB=(RECFM=VB,LRECL=12288)                                  00100000
//ADUPRINT  DD SYSOUT=*                                                 00110000
//SMFDATA1  DD    DISP=SHR,DSN=SYS1.MAN1                                00120000
//SMFOUT    DD    DSN=&&SMFFILE,                                        00130000
//          DISP=(,PASS),                                               00140000
//          DCB=(RECFM=VBS,LRECL=32760,BLKSIZE=6240),                   00150000
//          UNIT=SYSDA,SPACE=(TRK,(1,1))                                00160000
//SYSPRINT  DD SYSOUT=*                                                 00170000
//SYSIN     DD    *                                                     00180000
 INDD(SMFDATA1,OPTIONS(DUMP))                                           00190000
 ABEND(NORETRY)                                                         00200000
 OUTDD(SMFOUT,TYPE(80))                                                 00210000
 USER2(SMF$XT30)                                                        00220000
 USER3(SMF$XT31)                                                        00230000
/*                                                                      00240000
//FLTPRINT  DD   SYSOUT=*                                               00250000
//FLTINPUT  DD  *                                                       00260000
*                                                                       00270000
*  THIS SAMPLE FILTERS THE SMF RECORDS.  ONLY RECORDS WHICH MATCH       00280000
*  WILL BE THEN PROCESSED BY THE IBM IRRADU00/86 EXITS.                 00290000
*  HENCE ONLY IRRADU00 RECORDS WILL BE GENERATED FOR FURTHER PROCESSING 00300000
*  REALLY NEEDED.  IBM'S IRRADU00 HAS "NO" FILTERING TECHNIQUES AT ALL. 00310000
*                                                                       00320000
*                                                                       00330000
+OPTIONS    STOPAFT=100,SKIPREC=,DUMPREC=V,LRECL=,HITS=ONLY             00340000
*                                                                       00350000
*                                                                       00360000
*                                                                       00370000
*  WHEN USING A GENERIC SEARCH("CG") THE LENGTH BYTE IS IRRELEVANT.     00380000
*  THE LENGTH WITHIN THE RELOCATEABLE SECTION WILL BE USED IF SET       00390000
*  SET TO "0".                                                          00400000
*                                                                       00410000
*  USING SYMBOLIC NAMES INSTEAD FOR THE SAMPLE BELOW:                   00420000
*                                                                       00430000
*           COND=((0006,1,HX,EQ,50),AND,                                00440000
*                ((0001(0004,H38,H40,I1,0),1,HX,EQ,04),AND,             00450000
*                 (0001(0004,H38,H40,I1,2),1,HX,EQ,80)),AND,            00460000
*                ((0001(0004,H38,H40,I1,0),1,HX,EQ,01),AND,             00470000
*                 (0001(0004,H38,H40,I1,2),0,CG,EQ,RA**)))              00480000
*                                                                       00490000
*                                                                       00500000
*                                                                       00510000
* NOTE: TESTING FOR A RELOCATABLE VALUE E.G. "040180"                   00520000
*       THIS MUST BE DONE IN PAIRS. THAT MEANS WE HAVE TO TEST          00530000
*       ON X'04'(SMF80DTP) AND X'80'(SMF80DTA):                         00540000
*     "(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTP),1,HX,EQ,04)" AND  00550000
*     "(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTA),0,HX,EQ,80)"      00560000
*                                                                       00570000
*      HENCE FOR THE SMF80DTP X'04' YOU MUST DEFINE THE LENGTH FOR IT.  00580000
*      FOR THE VALUE X'80' AT OFFSET SMF80DTA NO LENGTH MUST BE DEFINED 00590000
*      AS THE LENGTH WILL BE AUTOMATICALLY EXTRACTED WHEN SET TO '0'.   00600000
*      HOWEVER A LENGTH CAN BE DEFINED.                                 00610000
*                                                                       00620000
*                                                                       00630000
*      THIS SAMPLE BELOW EXTRACTS ALL RECORDS WHERE THE                 00640000
*      "ACCESS ALLOWED" IS "ALTER"  AND THE                             00650000
*      "RESOURCE NAME OR OLD RESOURCE NAME" STARTS WITH "RA**".         00660000
*                                                                       00670000
*      TESTING FOR A RELOCATABLE VALUE: "040180"  AND                   00680000
*                                       "01LLXXXX......"                00690000
*                                        . . .                          00700000
*                                        . . .= RESNAME AT SMF80DTA     00710000
*                                        . .                            00720000
*                                        . .                            00730000
*                                        . LL = INT.LENGTH AT SMF80DLN  00740000
*                                        .                              00750000
*                                        DATA TYPE SMF80DTP             00760000
*                                                                       00770000
+INCLUDE    COND=(,                                                     00780000
(SMF80RTY,1,HX,EQ,50),AND,                                              00790000
((1(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTP),1,HX,EQ,04),AND,      00800000
 (1(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTA),0,HX,EQ,80)),AND,     00810000
((1(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTP),1,HX,EQ,01),AND,      00820000
 (1(SMF80FLG,SMF80REL,SMF80CNT,SMF80DLN,SMF80DTA),0,CG,EQ,RA**)))       00830000
*                                                                       
//                                                                      




Sample 6 using a subsystem
//IFASMFDP  EXEC  PGM=IFASMFDP                                          00070000
//STEPLIB   DD DISP=SHR,DSN=RA2002.V3R7M0.LINKLIB1                      00080000
//          DD DISP=SHR,DSN=RA2002.V3R7M0.LINKLIB                       00090000
//SMFDATA1  DD DISP=SHR,DSN=SYS1.MAN1                                   00100000
//SMFDATA2  DD DISP=SHR,DSN=SYS1.MAN2                                   00110000
//SMFDATA3  DD DISP=SHR,DSN=SYS1.MAN3                                   00120000
//*                                                                     00130000
//* SUBSYSTEM REQUIREMENTS:                                             00140000
//*                                                                     00150000
//* 1.                                                                  00160000
//* THE SUBSYSTEM MUST BE DEFINED IN YOUR PARMLIB(IEFSSN??):            00170000
//* SUBSYS SUBNAME(RA20)     INITRTN(ALS$INIT)                          00180000
//*                                                                     00190000
//* OR USE COMMAND: SETSSI ADD,S=RA20,I=ALS$INIT                        00200000
//*                 ALS2$INIT-10I SUBSYSTEMS RA20 HAS BEEN INITIALIZED. 00210000
//*                                                                     00220000
//* 2.                                                                  00230000
//* THE RA2002 LINKLIBS MUST APF LINKLISTED!                            00240000
//*                                                                     00250000
//*                                                                     00260000
//* 3.                                                                  00270000
//* IT IS MANDATORY THAT YOU TEST THE SUBSYSTEM FIRST IN A TEST         00280000
//* ENVIORNMENT.                                                        00290000
//*                                                                     00300000
//*                                                                     00310000
//* 4.                                                                  00320000
//* THE PROGRAMS ALS$1000 AND ALS$1002 HANDLE THE FILTERING AND         00330000
//* THE RE-ROUTING OF THE IRRADU00 //OUTDD  OUTPUT TO //OUTDDNEW.       00340000
//* NONE OF THE DATA GETS MODFIED BY THE SUBSYSTEM.                     00350000
//*                                                                     00360000
//*                                                                     00370000
//*                                                                     00380000
//OUTDD     DD SUBSYS=(RA20,ALS$1000,ALS$1002),                         00390000
//          DCB=(RECFM=VB,LRECL=12288)                                  00400000
//OUTDDNEW  DD DISP=SHR,DSN=XRZP001.IRRADU00.OUTDDNEW,                  00410000
//          DCB=(RECFM=VB,LRECL=12288)                                  00420000
//SMFOUT    DD DUMMY                                                    00430000
//SYSPRINT  DD SYSOUT=*                                                 00440000
//ADUPRINT  DD SYSOUT=*                                                 00450000
//SYSIN     DD    *                                                     00460000
 INDD(SMFDATA1,OPTIONS(DUMP))                                           00470000
 INDD(SMFDATA2,OPTIONS(DUMP))                                           00480000
 INDD(SMFDATA3,OPTIONS(DUMP))                                           00490000
 ABEND(NORETRY)                                                         00500000
 OUTDD(SMFOUT,TYPE(80))                                                 00510000
 USER2(IRRADU00)                                                        00520000
 USER3(IRRADU86)                                                        00530000
/*                                                                      00540000
//FLTPRINT  DD   SYSOUT=*                                               00550000
//FLTINPUT  DD  *                                                       00560000
*                                                                       00570000
*  THIS PROGRAM, A SUBSYSTEM, TRAPS GENERATED IRRADU00 DATA.            00580000
*  IRRADU00 HAS NO FILTERING FEATURE.  WITH A SUBSYSTEM CALLED          00590000
*  RA20 IT IS POSSIBLE TO FILTER SUCH RECORDS BEFORE THEY ARE           00600000
*  WRITTEN TO THE FILE CALLED //OUTDDNEW.                               00610000
*                                                                       00620000
*  BELOW ARE SAMPLES ON HOW TO WORK WITH POSITIONAL PARAMETERS OR       00630000
*  BY USING SYMBOLIC NAMES.  THE SYMBOLIC NAMES ARE THE SAME AS         00640000
*  OUTLINED BY IBM UNDER IRRADU00.                                      00650000
*                                                                       00660000
*                                                                       00670000
*  SAMPLE 1: USING SYMBLIC NAMES                                        00680000
*            WHEN USING SYMBOLIC NAMES AND NO LENGTH AND                00690000
*            FORMAT MUST BE DEFINED.                                    00700000
*            THESE VALUES CAN BE MARKED BY AN "*".                      00710000
*                                                                       00720000
*                                                                       00730000
+OPTIONS    DUMPREC=V,STOPAFT=20                                        00740000
+INCLUDE    COND=(ACC_EVENT_TYPE,*,*,EQ,ACCESS,AND,                     00750000
                  ACC_RES_NAME,*,CG,EQ,RA*.**,AND,                      00760000
                  ACC_CLASS,*,*,EQ,DATASET)                             00770000
*INCLUDE    COND=(ACC_CLASS,*,*,EQ,PROGRAM)                             00780000
//                                                                      00790000
*                                                                       00800000
*  SAMPLE 2:  USING POSITIONAL VALUES INSTEAD.                          00810000
*                                                                       00820000
+OPTIONS    DUMPREC=V                                                   00830000
+INCLUDE    COND=(5,008,CG,EQ,ACC*,AND,286,44,CG,EQ,RA2002.V3R7M0*.**,  00840000
                  AND,578,8,CH,EQ,DATASET)                              00850000
//                                                                      00860000